#ifndef __MCS__VARIABLE_NOT_FOUND_EXCEPTION__HPP
#define __MCS__VARIABLE_NOT_FOUND_EXCEPTION__HPP

#include "CompileException.hpp"

class VariableNotFoundException : public CompileException
{
public:
	VariableNotFoundException(String const & name, SourceLocation const & location)
		: CompileException(location), name_(name)
	{}

	String name() const { return name_; }

	virtual std::ostream & stream(std::ostream & str) const
	{
		return CompileException::stream(str) << "variable named \"" << name_ << "\" is not defined";
	}
private:
	String name_;
};

#endif //__MCS__VARIABLE_NOT_FOUND_EXCEPTION__HPP
